<template lang="html">
  <div class="index-board-list">
    <div class="index-board-item"
      v-for="(item, index) in boardList"
      :class="[{'line-last' : index % 2 !== 0}, 'index-board-' + item.id]"
      :key="item.id">
      <div class="index-board-item-inner" >
        <h2>{{ item.title }}</h2>
        <p>{{ item.description }}</p>
        <div class="index-board-button">
          <router-link class="button" :to="{path: 'detail/' + item.toKey}">
            <el-button type="success" size="small" plain>立即购买</el-button>
          </router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomeProject',
  data () {
    return {
      boardList: [
        {
          title: '开放产品',
          description: '开放产品是一款开放产品',
          id: 'car',
          toKey: 'analysis',
          saleout: false
        },
        {
          title: '品牌营销',
          description: '品牌营销帮助你的产品更好地找到定位',
          id: 'earth',
          toKey: 'count',
          saleout: false
        },
        {
          title: '使命必达',
          description: '使命必达快速迭代永远保持最前端的速度',
          id: 'loud',
          toKey: 'forecast',
          saleout: true
        },
        {
          title: '勇攀高峰',
          description: '帮你勇闯高峰，到达事业的顶峰',
          id: 'hill',
          toKey: 'publish',
          saleout: false
        }
      ]
    }
  }
}
</script>

<style lang="css" scoped>
.index-board-list {
  overflow: hidden;
}
.index-board-item {
  float: left;
  width: 400px;
  background: #fff;
  box-shadow: 0 0 1px #ddd;
  padding: 20px;
  margin-right: 20px;
  margin-bottom: 20px;
}
.index-board-item-inner {
  min-height: 125px;
  padding-left: 120px;
}
.index-board-car .index-board-item-inner{
  background: url(../../../assets/1.png) no-repeat;
}
.index-board-loud .index-board-item-inner{
  background: url(../../../assets/2.png) no-repeat;
}
.index-board-earth .index-board-item-inner{
  background: url(../../../assets/3.png) no-repeat;
}
.index-board-hill .index-board-item-inner{
  background: url(../../../assets/4.png) no-repeat;
}
.index-board-item h2 {
  font-size: 18px;
  font-weight: bold;
  color: #000;
  margin-bottom: 15px;
}
.line-last {
  margin-right: 0;
}
.index-board-button {
  margin-top: 20px;
}
.lastest-news {
  min-height: 512px;
}
.hot-tag {
  background: red;
  color: #fff;
}
.new-item {
  display: inline-block;
  width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.el-button--success.is-plain{
  color: #fff;
  background: #33BF82;
}
</style>
